package com.tc.juc;

import lombok.extern.slf4j.Slf4j;
import org.openjdk.jol.info.ClassLayout;

import java.util.concurrent.TimeUnit;

/**
 * @Auther: tianchao
 * @Date: 2021/10/1 01:18
 * @Description:
 */
@Slf4j
public class TestBiased {
    public static void main(String[] args) throws InterruptedException {
        Dog d = new Dog();
        log.debug(ClassLayout.parseInstance(d).toPrintable());
        synchronized (d){
            log.debug(ClassLayout.parseInstance(d).toPrintable());
        }
        log.debug(ClassLayout.parseInstance(d).toPrintable());
    }
    public void testBiased() throws InterruptedException {
        String classLayout = ClassLayout.parseInstance(new Dog()).toPrintable();
        log.info("classLayout: {}",classLayout);
        TimeUnit.SECONDS.sleep(6);
        String classLayout2 = ClassLayout.parseInstance(new Dog()).toPrintable();
        log.info("classLayout: {}",classLayout2);
    }
}
class Dog{

}
